#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <timer.h>
#include "FreeRTOS.h"
#include "task.h"
#include "system_LPC17xx.h"
#include "GLCD.h"
#include "vtUtilities.h"
#include "LCDtask.h"
#include "string.h"
#include "math.h"
#include "lpc17xx_pinsel.h"
#include "lpc17xx_libcfg_default.h"
#include "CommsDefs.h"
#include <stdlib.h>     /* srand, rand */



#define CMDSlightLeftL 0x2D
#define CMDSlightLeftR 0xD3

#define CMDSlightRightL 0x54
#define CMDSlightRightR 0xAC

#define CMDStraightL 0x4C
#define CMDStraightR 0xCC

#define CMDStopL 0x40
#define CMDStopR  0xC0

#define CMDTurnLeftL 0x2B
#define CMDTurnLeftR 0xD4

#define CMDTurnRightL 0x54
#define CMDTurnRightR 0xAB

#define CMDReverseL 0x20
#define CMDReverseR 0xA0


void Init_CommandThread();
void CalculateCommand(unsigned char msg);
void AddMsgToHistory(unsigned char msg);